<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<%
request.setCharacterEncoding("utf-8");
%>
<!-- 获取request对象并获取serlvet路径 -->
${pageContext.request.servletPath}
<br>
<!-- 获取response对象并获取上下文类型 -->
${pageContext.response.contentType }
<br>
<!-- 获取out对象并获取缓冲区大小 -->
${pageContext.out.bufferSize}
<br>
<!-- 获取session对象并获取session的有效时间 -->
${pageContext.session.maxInactiveInterval }
<br>
<!-- 获取exception对象并获取相应的错误信息 -->
${pageContext.exception.message }
<br>
<!-- 获取page对象并获取当前类文件 -->
<%-- ${pageContext.page.class} --%>
<br>
<!-- 获取servletContext对象并获取servlet上下文信息(/项目名) -->
${pageContext.servletContext.contextPath }
<br>

<jsp:useBean id="user" class="JSPBasicGrammar.elexpression07.overview.User" scope="page"></jsp:useBean>
<jsp:setProperty property="name" name="user" value="黄彪"/>
<jsp:setProperty property="age" name="user" value="19"/>

${pageScope.user.name}


<form action="#" method="post">
<input type="text" name="name">
<input type="password" name="password">
<input type="checkbox" name="like" value="游泳">游泳
<input type="checkbox" name="like" value="骑单车">骑单车
<input type="checkbox" name="like" value="跑步">跑步
<input type="checkbox" name="like" value="踢毽子">踢毽子
<input type="submit" value="提交">
</form>
<!-- 获取表单提交的内容 -->
${param.name}
${param.password }

<%
//循环遍历复选框中所选的值
for(int j=0;j<4;j++){
	
	request.setAttribute("index", j);
%>

${paramValues.like[index]}

<%
}
%>
 <!-- 获取HTTP请求中一个/多个header值  -->
${header.connection }
${header["user-agent"] }

<!-- 获取初始化参数的值 -->
${initParam.author }

<!-- 获取cookie对象的值-->
<%

Cookie cookies=new Cookie("user","胡歌");
response.addCookie(cookies);

%>
${cookie.user.value}


</body>
</html>